#include<stdio.h>
int main()
{
	int n,i,a,j;
	scanf("%d",&n);
	int num;
	for (i=0;i<n;i++)
	{
		a=0;
		scanf ("%d",&num);
		for (j=2;j<=num;j+=2)
		{
			if (num%j==0)
			{
			  a=1;
              printf("%d ",j);
            }
		}
		if (a==1)
		printf("\n");
		else
		printf("%dhas no even factors\n",num);
	}
	return 0;
}
